﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="sms_type.aspx.vb" Inherits="webfinancegdrassign4.sms_type" %>



<%--Smart Money $aver Project for University of Herts--%>
<%--Date: 01 December 2013--%>
<%--Version 1--%>
<%--Project Brief Description - This is a Smart Money Saver asp.net product using VB.net. It is intended to be used by Smart Money Savers who want to make and save money and earn and save a certain amount to benefit--%>
<%--Program Brief Description - This is the main Site.Master file. All change appear on all pages. This is a standard program from a default build from setting up the project in Visual Studio --%>
<%--Changes - Added an image for the Smart Investor program / website --%>
<%--Changes - Changed original Texts to 'Smart Money $aver ' --%>

<%--Update 1 -  5th Jan 2014 - sms_comments.aspx enabled page to allow admin user to update,delete and select data from Table --%>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


    <script type="text/javascript">
        function newPopup1(url) {
            popupWindow = window.open(
            url, 'popUpWindow', 'height=450,width=920,left=200,top=20,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
        }
    </script>


    <asp:UpdatePanel ID="jlkj" runat="server">
        <ContentTemplate>



            <div class="hero-unit">

                <div class="row-fluid">
                    <div id='cssmenu'>
                        <ul>
                            <li><a href="sms_comments.aspx"><span>Comments</span></a></li>
                            <li><a href="sms_info_about.aspx"><span>Info About</span></a></li>
                            <li><a href="sms_money_data.aspx"><span>Money Data</span></a></li>
                            <li><a href="sms_moneyjunction.aspx"><span>Money Junction</span></a></li>
                            <li><a href="sms_moneytype.aspx"><span>Money Type</span></a></li>
                            <li><a href="sms_tags.aspx"><span>Tags</span></a></li>
                            <li class='active'><a href="sms_type.aspx"><span>User Type</span></a></li>
                        </ul>
                    </div>
                    <div style="margin-top: 10px;">

                        <%--<input type="button" value="Add Comments" class="button" style="float: right; width: 116px;" onclick="return window.open('AddComment.aspx', 'mywindow', 'menubar=1,resizable=1,width=650,height=400,top=100,left=400');" />--%>
                    </div>
                </div>
                <hgroup></hgroup>

                <h2 style="color: #999;">Edit Type Information<asp:Button runat="server" ID="btnAddComments" Text="Add SmsType" CssClass="button" Style="float: right; width: 116px;" OnClientClick="JavaScript:newPopup1('AddSmsType.aspx');" /></h2>
                <div class="head-2">



                    <asp:GridView ID="GridView1" CssClass="Grid" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource5" DataKeyNames="ID" AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowEditing="GridView1_RowEditing" OnRowDeleting="GridView1_RowDeleting" Width="100%">
                        <AlternatingRowStyle BackColor="White" />

                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <itemstyle width="10%" />
                                    <asp:ImageButton ID="imgdelete" runat="server" CommandName="Delete" ToolTip="Delete" CausesValidation="false" Width="25" ImageUrl="~/img/Delete.png" OnClientClick="return confirm('Do you want to Delete this Recored')" />
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField>
                                <ItemStyle Width="10%" />
                                <ItemTemplate>

                                    <asp:ImageButton ID="imgEdit" runat="server" CommandName="Edit" ToolTip="Edit" CausesValidation="false" Width="25" ImageUrl="~/img/1leftarrow.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--<asp:TemplateField HeaderText="User Type Id" Visible="false" >
                                <ItemStyle Width="40%" />
                                <ItemTemplate>

                                    <%# DataBinder.Eval(Container.DataItem, "ID")%>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                            <asp:TemplateField HeaderText="User Type Name">
                                <ItemStyle Width="80%" />
                                <ItemTemplate>

                                    <%# DataBinder.Eval(Container.DataItem, "usertype")%>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <%--                            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" />
                            <asp:BoundField DataField="usertype" HeaderText="usertype" SortExpression="usertype" />--%>
                        </Columns>



                        <EditRowStyle BackColor="#FFFF99" />

                        <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle HorizontalAlign="Left" />
                        <RowStyle BackColor="#EFF3FB" />

                        <SelectedRowStyle Font-Bold="True" ForeColor="#FFFF99" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />


                    </asp:GridView>

                    <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString001 %>" ProviderName="<%$ ConnectionStrings:ConnectionString001.ProviderName %>" SelectCommand="SELECT [ID], [usertype] FROM [sms_usertype]">
                        <DeleteParameters>
                            <asp:Parameter Name="ID" Type="Int32" />
                            <asp:Parameter Name="usertype" Type="String" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="ID" Type="Int32" />
                            <asp:Parameter Name="usertype" Type="String" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ID" Type="Int32" />
                            <asp:Parameter Name="usertype" Type="String" />
                        </UpdateParameters>
                    </asp:SqlDataSource>

                    <br />
                    <br />
                    <div class="row-fluid">

                        <table class="table">
                            <tr>
                                <th colspan="4" class="td-head"><span class="spanhead">Edit Record<asp:Button ID="Button1" runat="server" Text="Edit" CssClass="button" Style="width: 70px; margin-left: 50px;" OnClick="Button1_Click" />&nbsp;<asp:Button ID="btncancel" runat="server" Text="Cancel" Width="80" CssClass="button" OnClick="btncancel_Click" />&nbsp;<asp:Button ID="Button2" runat="server" Height="36px" Text="Return to Main Menu" PostBackUrl="~/Account/Admininput.aspx" CssClass="button" /></span></th>
                            </tr>
                            <tr>
                                <td class="frm-lft-clr123">
                                    <asp:Label ID="Label9" runat="server" Text="Sms Type"></asp:Label></td>
                                <td class="frm-rght-clr123">
                                    <asp:TextBox ID="txt_sms_type" runat="server" CssClass="textbox"></asp:TextBox></td>


                            </tr>
                        </table>
                        <asp:HiddenField ID="hdn_id" runat="server" />
                    </div>
                </div>
            </div>
        </ContentTemplate>
      
          <Triggers>
                <asp:PostBackTrigger ControlID="Button1"  />
            <asp:PostBackTrigger ControlID="GridView1" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
